console.log('hello');
let a: number;
a = 10;
let s: string;
let e: unknown = "str";
//unknown 赋值给别人需要先判断类型
if (typeof e === "string") {
  s = e;
}
//或者类型断言
s = e as string;
s = <string>e;
function fn(num:number): void {
  if (num>0) {
    return; //不应有返回值
  } else {
    return undefined;
  }
}
function fn2(): never{
  throw new Error("出错了");//就是执行不完 一定会出错
}
